package com.cj.logc.simple

import org.junit.Test

import org.junit.Assert.*

/**
 * Example local unit test, which will execute on the development machine (host).
 *
 * See [testing documentation](http://d.android.com/tools/testing).
 */
class ExampleUnitTest {
    @Test
    fun addition_isCorrect() {
        assertEquals(4, 2 + 2)
    }

    @Test
    fun test_list_string_sort(){
        val list = arrayOf<String>(
            "2022-05",
            "2022-01",
            "2022-10",
            "2022-03",
            "2022-12",
            "2022-02",
            "2022-06",
            "2022-07",
            "2022-08",
            "2022-09",
            "2022-04",
            "2022-11",

        )
        list.apply {
            sortBy { it }
            reverse()
        }
        println("result:${list.contentToString()}")

        val list2 = arrayOf<String>(
            "2022-05-01",
            "2022-05-02",
            "2022-05-31",
            "2022-05-04",
            "2022-05-05",
            "2022-05-20",
            "2022-05-07",
            "2022-05-08",
            "2022-05-09",
            "2022-05-10",
            "2022-05-25",
            "2022-05-12",
            "2022-05-13",
            "2022-05-14",
            "2022-05-06",
            "2022-05-16",
            "2022-05-17",
            "2022-05-18",
            "2022-05-19",

            "2022-05-21",
            "2022-05-22",
            "2022-05-23",
            "2022-05-24",
            "2022-05-15",
            "2022-05-26",
            "2022-05-27",
            "2022-05-28",
            "2022-05-29",
            "2022-05-30",
            "2022-05-11",
            "2022-05-03",

            )
        list2.apply {
            sortBy { it }
            reverse()
        }
        println("result2:${list2.contentToString()}")
    }
}